/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * FormLPegawai.java
 *
 * Created on Feb 2, 2011, 4:56:34 PM
 */

package juwita;

import javax.swing.JOptionPane;

/**
 *
 * @author Abah
 */
public class FormLPegawai extends javax.swing.JInternalFrame {

    /** Creates new form FormLPegawai */
    public FormLPegawai() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        previewButton = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();

        setBackground(new java.awt.Color(255, 255, 255));
        setClosable(true);
        setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
        setIconifiable(true);
        setMaximizable(true);
        setResizable(true);
        setTitle("Laporan Pegawai");
        setFrameIcon(new javax.swing.ImageIcon(getClass().getResource("/resource/lap_peg.png"))); // NOI18N
        addInternalFrameListener(new javax.swing.event.InternalFrameListener() {
            public void internalFrameActivated(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameClosed(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameClosing(javax.swing.event.InternalFrameEvent evt) {
                formInternalFrameClosing(evt);
            }
            public void internalFrameDeactivated(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameDeiconified(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameIconified(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameOpened(javax.swing.event.InternalFrameEvent evt) {
            }
        });
        getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        previewButton.setText("preview");
        previewButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                previewButtonActionPerformed(evt);
            }
        });
        getContentPane().add(previewButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 80, 100, 30));

        jLabel1.setForeground(new java.awt.Color(0, 0, 255));
        jLabel1.setText("Laporan Seluruh Data Pegawai");
        getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 40, -1, -1));

        setBounds(0, 0, 276, 186);
    }// </editor-fold>//GEN-END:initComponents

    private void formInternalFrameClosing(javax.swing.event.InternalFrameEvent evt) {//GEN-FIRST:event_formInternalFrameClosing
        // TODO add your handling code here:
        int clossing;
        clossing = JOptionPane.showConfirmDialog(this,
                "Tutup Laporan Pegawai?",
                "Konfirmasi",
                JOptionPane.YES_NO_OPTION);
        if (clossing == 0){
            this.dispose();
            FormMain.isfLPeg = false;
        }
    }//GEN-LAST:event_formInternalFrameClosing

    private void previewButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_previewButtonActionPerformed
        //oi
        
        ReportView rv = new ReportView("RptPegawai.jrxml");
        //ReportView.rName = "coba";
        //rv.setReportName("yo!");
        //rv.setReportName("RptPegawai.jrxml");
        //ReportView.setReportName("RptPegawai.jrxml");
        //rv.setSize(Toolkit.getDefaultToolkit().getScreenSize());
        //rv.validate();
        
        rv.setExtendedState(ReportView.MAXIMIZED_BOTH);
        
        rv.setVisible(true);
        
        
}//GEN-LAST:event_previewButtonActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabel1;
    private javax.swing.JButton previewButton;
    // End of variables declaration//GEN-END:variables

}
